﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Security.Policy;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
using Compiler.CompilerLogic;

namespace Compiler.LabLogic
{
    [Serializable]
    public class TokenModel
    {
        public int ImageIndex;
        public string Value;
        public string ToolTipText;

        public TokenModel(int imageIndex, string value, string toolTipText)
        {
            ImageIndex = imageIndex;
            Value = value;
            ToolTipText = toolTipText;
        }
    }

    [Serializable]
    public class IdentifierModel
    {
        public string Id;
        public string Value;
        public string Type;
        public string Level;

        public IdentifierModel(string id, string value, string type, string level)
        {
            Id = id;
            Value = value;
            Type = type;
            Level = level;
        }
    }

    [Serializable]
    public class ConstantModel
    {
        public string Id;
        public string Value;

        public ConstantModel(string id, string value)
        {
            Id = id;
            Value = value;
        }
    }

    [Serializable]
    public class TetradeModel
    {
        public string Operation;
        public string OperandOne;
        public string OperandTwo;
        public string Result;

        public TetradeModel(string operation, string operandOne, string operandTwo, string result)
        {
            Operation = operation;
            OperandOne = operandOne;
            OperandTwo = operandTwo;
            Result = result;
        }
    }

    [Serializable]
    public class LabModel
    {
        public bool CodeLoaded = true;
        public string CodePageHeader;
        public string[] CodeBoxLines;
        public bool CodeScrollbars = false;
        public Font CodeBoxFont;
        public bool CodeBoxEnabled;
        public HorizontalAlignment CodeBoxAlignment;
        public bool CheckCodeVisible = false;
        public bool CodeEnabled = true;
        
        public bool LexicalEnabled;
        public List<TokenModel> Tokens = new List<TokenModel>();
        public List<IdentifierModel> Identifiers = new List<IdentifierModel>();
        public List<ConstantModel> Constants = new List<ConstantModel>();

        public bool SyntaxEnabled;
        public SyntaxNode TreeRoot = new SyntaxNode("Program", "", null);

        public bool GenerationEnabled;
        public bool TetradesEnabled;
        public List<TetradeModel> Tetrades = new List<TetradeModel>(); 

        public bool AssemblyCodeEnabled;
        public List<string> AssemblyCodeLines = new List<string>();
    }
}